feat: OGG/Opus import and OGG export (#330) - #331
Merged
Conversation
Import: accept .ogg (Vorbis or Opus in Ogg) and .opus uploads. The pipeline already transcodes every local upload to 16-bit/44.1 kHz WAV via ffmpeg before Demucs, so only the extension allow-lists change: the API gate, the web file picker/drop validation, and the mobile accept list (which already advertised .ogg but got a server 422). Export: add OGG (Vorbis VBR q6, ~192 kbps — the quality tier matching the MP3 setting) to the mixdown, region, and stems-zip endpoints plus the export format toggle in the player. Tests: the unsupported-extension fixtures used .ogg and now use .aiff; new upload tests for .ogg/.opus and an ffmpeg-gated OGG zip transcode test asserting real OggS output. Closes #330
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds OGG/Opus import and OGG export, closing #330.
Import (
.ogg+.opus)The pipeline was already format-agnostic — every local upload is transcoded to 16-bit/44.1 kHz stereo WAV by ffmpeg (
_prepare_local_source) before Demucs runs — so the only barriers were extension allow-lists:app/api/jobs.py—_ALLOWED_EXTS+ the 422 detail stringstatic/index.html— file-pickeraccept=liststatic/js/main.js— drop/picker validation + error messagestatic/mobile/app.js— adds.opus; fixes a latent bug: the mobile accept list already advertised.oggbut the server rejected it with a raw 422.oggcovers both Vorbis and Opus-in-Ogg;.opusis the Opus convention. ffmpeg decodes both — no codec branching.Export (OGG)
Following the FLAC precedent (#194): OGG (Vorbis VBR q6, ~192 kbps — the quality tier matching the existing MP3 setting) added to
app/api/stems.py—_ENCODE_ARGS/MIXDOWN_CODECS/media types, mixdown + region +all.zipvalidationstatic/index.html+static/js/main.js— OGG button in the export format toggle (download helpers were already format-generic)Tests
oggas the "unsupported" fixture (now.aiff)test_upload_ogg_returns_job_id,test_upload_opus_returns_job_id, and an ffmpeg-gatedtest_all_stems_zip_oggasserting realOggSoutputVerification
ruff check+ruff format --checkboth clean_prepare_local_sourceffmpeg command shape — both transcode to the expected 44.1 kHz stereo s16 WAV